﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="quangcao.aspx.cs" Inherits="Admin_quangcao" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

        .style2
        {
            width: 112px;
            height: 22px;
        }
        .style3
        {
            height: 22px;
        }
        .style1
        {
            width: 112px;
        }
        </style>
</head>
<body>
    <form id="form2" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [Quangcao]" 
            ConflictDetection="CompareAllValues" 
            DeleteCommand="DELETE FROM [Quangcao] WHERE [id_row] = @original_id_row AND (([tieude] = @original_tieude) OR ([tieude] IS NULL AND @original_tieude IS NULL)) AND (([hinhanh] = @original_hinhanh) OR ([hinhanh] IS NULL AND @original_hinhanh IS NULL)) AND (([link] = @original_link) OR ([link] IS NULL AND @original_link IS NULL)) AND (([vitri] = @original_vitri) OR ([vitri] IS NULL AND @original_vitri IS NULL)) AND (([ngaybatdau] = @original_ngaybatdau) OR ([ngaybatdau] IS NULL AND @original_ngaybatdau IS NULL)) AND (([ngayketthuc] = @original_ngayketthuc) OR ([ngayketthuc] IS NULL AND @original_ngayketthuc IS NULL)) AND (([hienthi] = @original_hienthi) OR ([hienthi] IS NULL AND @original_hienthi IS NULL))" 
            InsertCommand="INSERT INTO [Quangcao] ([tieude], [hinhanh], [link], [vitri], [ngaybatdau], [ngayketthuc], [hienthi]) VALUES (@tieude, @hinhanh, @link, @vitri, @ngaybatdau, @ngayketthuc, @hienthi)" 
            UpdateCommand="UPDATE [Quangcao] SET [tieude] = @tieude, [hinhanh] = @hinhanh, [link] = @link, [vitri] = @vitri, [ngaybatdau] = @ngaybatdau, [ngayketthuc] = @ngayketthuc, [hienthi] = @hienthi WHERE [id_row] = @original_id_row AND (([tieude] = @original_tieude) OR ([tieude] IS NULL AND @original_tieude IS NULL)) AND (([hinhanh] = @original_hinhanh) OR ([hinhanh] IS NULL AND @original_hinhanh IS NULL)) AND (([link] = @original_link) OR ([link] IS NULL AND @original_link IS NULL)) AND (([vitri] = @original_vitri) OR ([vitri] IS NULL AND @original_vitri IS NULL)) AND (([ngaybatdau] = @original_ngaybatdau) OR ([ngaybatdau] IS NULL AND @original_ngaybatdau IS NULL)) AND (([ngayketthuc] = @original_ngayketthuc) OR ([ngayketthuc] IS NULL AND @original_ngayketthuc IS NULL)) AND (([hienthi] = @original_hienthi) OR ([hienthi] IS NULL AND @original_hienthi IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_id_row" Type="Decimal" />
                <asp:Parameter Name="original_tieude" Type="String" />
                <asp:Parameter Name="original_hinhanh" Type="String" />
                <asp:Parameter Name="original_link" Type="String" />
                <asp:Parameter Name="original_vitri" Type="Int32" />
                <asp:Parameter Name="original_ngaybatdau" Type="DateTime" />
                <asp:Parameter Name="original_ngayketthuc" Type="DateTime" />
                <asp:Parameter Name="original_hienthi" Type="Boolean" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="tieude" Type="String" />
                <asp:Parameter Name="hinhanh" Type="String" />
                <asp:Parameter Name="link" Type="String" />
                <asp:Parameter Name="vitri" Type="Int32" />
                <asp:Parameter Name="ngaybatdau" Type="DateTime" />
                <asp:Parameter Name="ngayketthuc" Type="DateTime" />
                <asp:Parameter Name="hienthi" Type="Boolean" />
                <asp:Parameter Name="original_id_row" Type="Decimal" />
                <asp:Parameter Name="original_tieude" Type="String" />
                <asp:Parameter Name="original_hinhanh" Type="String" />
                <asp:Parameter Name="original_link" Type="String" />
                <asp:Parameter Name="original_vitri" Type="Int32" />
                <asp:Parameter Name="original_ngaybatdau" Type="DateTime" />
                <asp:Parameter Name="original_ngayketthuc" Type="DateTime" />
                <asp:Parameter Name="original_hienthi" Type="Boolean" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="tieude" Type="String" />
                <asp:Parameter Name="hinhanh" Type="String" />
                <asp:Parameter Name="link" Type="String" />
                <asp:Parameter Name="vitri" Type="Int32" />
                <asp:Parameter Name="ngaybatdau" Type="DateTime" />
                <asp:Parameter Name="ngayketthuc" Type="DateTime" />
                <asp:Parameter Name="hienthi" Type="Boolean" />
            </InsertParameters>
        </asp:SqlDataSource>
    
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="id_row" DataSourceID="SqlDataSource1" Width="767px">
            <Columns>
                <asp:BoundField DataField="tieude" HeaderText="tieude" 
                    SortExpression="tieude" />
                <asp:BoundField DataField="hinhanh" HeaderText="hinhanh" 
                    SortExpression="hinhanh" />
                <asp:BoundField DataField="link" HeaderText="link" SortExpression="link" />
                <asp:BoundField DataField="vitri" HeaderText="vitri" 
                    SortExpression="vitri" />
                <asp:BoundField DataField="ngaybatdau" HeaderText="ngaybatdau" 
                    SortExpression="ngaybatdau" DataFormatString="{0:dd/MM/yyyy}" />
                <asp:BoundField DataField="ngayketthuc" DataFormatString="{0:dd/MM/yyyy}" 
                    HeaderText="ngayketthuc" SortExpression="ngayketthuc" />
                <asp:CheckBoxField DataField="hienthi" HeaderText="hienthi" 
                    SortExpression="hienthi" />
                <asp:CommandField DeleteText="Xoa" ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
    
    </div>
    <br />
    them quang cao<br />
    <br />
    <table style="width:100%;">
        <tr>
            <td class="style2">
                Tieu de</td>
            <td class="style3">
                <asp:TextBox ID="txttieude" runat="server" Width="283px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Hinh anh</td>
            <td>
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style1">
                Link</td>
            <td>
                <asp:TextBox ID="txtLink" runat="server" Width="283px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Ngay bat dau</td>
            <td>
                <asp:Calendar ID="Calendar1" runat="server" 
                    onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Ngay ket thuc</td>
            <td>
                <asp:Calendar ID="Calendar2" runat="server"></asp:Calendar>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Vi tri</td>
            <td>
                <asp:TextBox ID="txtVitri" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Hien thi</td>
            <td>
                <asp:CheckBox ID="CheckBox1" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td>
                <asp:Button ID="btnthem" runat="server" onclick="btnthem_Click" Text="Them" />
                <asp:Button ID="btnxoa" runat="server" onclick="btnxoa_Click" Text="Xoa" />
            </td>
        </tr>
    </table>
    <br />
    </form>
</body>
</html>
